<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    var animal=new Array('dog','pig','cat','duck');

    animal.push("chicken","wolf","tiger","pig"); //向数组未尾添加两个元素
//    animal.pop();
//    animal.pop();
//    animal.pop();
//    animal.pop();
    console.log(animal);
    console.log(animal.indexOf("pig"));
    console.log(animal.lastIndexOf("pig"));
</script>
</body>
</html>